<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 5.4.0">
  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">


<link rel="stylesheet" href="/lib/font-awesome/css/all.min.css">

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"ckyhahaha.info","root":"/","scheme":"Gemini","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":false,"show_result":false,"style":null},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.xml"};
  </script>

  <meta name="description" content="简介​            编程通过结构+算法对数据的处理，那么在编程的时候，遇到或自己想到的优秀    的处理数据的方案，就需要记录下来方便再次使用，所以，“cky小站”应然而生，往后的编程生涯里学到的知识都会在这里记录。 建站想法​    需求：在本地编写md文档，快速部署到网页上  最开始的想法是动手写原生的，在前端项目里，把写好的md文档放在一个文件夹，通过webpack的loader去">
<meta property="og:type" content="article">
<meta property="og:title" content="jenkins+hexo搭建博客">
<meta property="og:url" content="https://ckyhahaha.info/2022/01/22/jenkins-hexo%E6%90%AD%E5%BB%BA%E5%8D%9A%E5%AE%A2/index.html">
<meta property="og:site_name" content="cky小站">
<meta property="og:description" content="简介​            编程通过结构+算法对数据的处理，那么在编程的时候，遇到或自己想到的优秀    的处理数据的方案，就需要记录下来方便再次使用，所以，“cky小站”应然而生，往后的编程生涯里学到的知识都会在这里记录。 建站想法​    需求：在本地编写md文档，快速部署到网页上  最开始的想法是动手写原生的，在前端项目里，把写好的md文档放在一个文件夹，通过webpack的loader去">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://ckyhahaha.info/2022/01/22/jenkins-hexo%E6%90%AD%E5%BB%BA%E5%8D%9A%E5%AE%A2/image-20220122173731512.png">
<meta property="og:image" content="https://ckyhahaha.info/2022/01/22/jenkins-hexo%E6%90%AD%E5%BB%BA%E5%8D%9A%E5%AE%A2/image-20220122165520669.png">
<meta property="og:image" content="https://ckyhahaha.info/2022/01/22/jenkins-hexo%E6%90%AD%E5%BB%BA%E5%8D%9A%E5%AE%A2/image-20220122170027143.png">
<meta property="og:image" content="https://ckyhahaha.info/2022/01/22/jenkins-hexo%E6%90%AD%E5%BB%BA%E5%8D%9A%E5%AE%A2/image-20220122193140980.png">
<meta property="og:image" content="https://ckyhahaha.info/2022/01/22/jenkins-hexo%E6%90%AD%E5%BB%BA%E5%8D%9A%E5%AE%A2/image-20220122180718570.png">
<meta property="og:image" content="https://ckyhahaha.info/2022/01/22/jenkins-hexo%E6%90%AD%E5%BB%BA%E5%8D%9A%E5%AE%A2/image-20220122181253153.png">
<meta property="og:image" content="https://ckyhahaha.info/2022/01/22/jenkins-hexo%E6%90%AD%E5%BB%BA%E5%8D%9A%E5%AE%A2/image-20220122181656701.png">
<meta property="og:image" content="https://ckyhahaha.info/2022/01/22/jenkins-hexo%E6%90%AD%E5%BB%BA%E5%8D%9A%E5%AE%A2/image-20220122182159824.png">
<meta property="og:image" content="https://ckyhahaha.info/2022/01/22/jenkins-hexo%E6%90%AD%E5%BB%BA%E5%8D%9A%E5%AE%A2/image-20220122182508961.png">
<meta property="og:image" content="https://ckyhahaha.info/2022/01/22/jenkins-hexo%E6%90%AD%E5%BB%BA%E5%8D%9A%E5%AE%A2/image-20220122182747306.png">
<meta property="article:published_time" content="2022-01-22T11:21:19.000Z">
<meta property="article:modified_time" content="2022-01-22T11:44:40.717Z">
<meta property="article:author" content="cky">
<meta property="article:tag" content="持续部署">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://ckyhahaha.info/2022/01/22/jenkins-hexo%E6%90%AD%E5%BB%BA%E5%8D%9A%E5%AE%A2/image-20220122173731512.png">

<link rel="canonical" href="https://ckyhahaha.info/2022/01/22/jenkins-hexo%E6%90%AD%E5%BB%BA%E5%8D%9A%E5%AE%A2/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true,
    lang   : 'zh-CN'
  };
</script>

  <title>jenkins+hexo搭建博客 | cky小站</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

<link rel="alternate" href="/atom.xml" title="cky小站" type="application/atom+xml">
</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <h1 class="site-title">cky小站</h1>
      <span class="logo-line-after"><i></i></span>
    </a>
      <p class="site-subtitle" itemprop="description">记录学习知识和生活中的点点滴滴</p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>




<nav class="site-nav">
  <ul id="menu" class="main-menu menu">
        <li class="menu-item menu-item-home">

    <a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a>

  </li>
        <li class="menu-item menu-item-about">

    <a href="/about" rel="section"><i class="fa fa-user fa-fw"></i>关于</a>

  </li>
        <li class="menu-item menu-item-tags">

    <a href="/tags" rel="section"><i class="fa fa-tags fa-fw"></i>标签<span class="badge">4</span></a>

  </li>
        <li class="menu-item menu-item-categories">

    <a href="/categories" rel="section"><i class="fa fa-th fa-fw"></i>分类<span class="badge">4</span></a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/archives" rel="section"><i class="fa fa-archive fa-fw"></i>归档<span class="badge">4</span></a>

  </li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
        </a>
      </li>
  </ul>
</nav>



  <div class="search-pop-overlay">
    <div class="popup search-popup">
        <div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocapitalize="off"
           placeholder="搜索..." spellcheck="false"
           type="search" class="search-input">
  </div>
  <span class="popup-btn-close">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div id="search-result">
  <div id="no-result">
    <i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i>
  </div>
</div>

    </div>
  </div>

</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content post posts-expand">
            

    
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://ckyhahaha.info/2022/01/22/jenkins-hexo%E6%90%AD%E5%BB%BA%E5%8D%9A%E5%AE%A2/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.jpg">
      <meta itemprop="name" content="cky">
      <meta itemprop="description" content="相见恨晚">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="cky小站">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          jenkins+hexo搭建博客
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>
              

              <time title="创建时间：2022-01-22 19:21:19 / 修改时间：19:44:40" itemprop="dateCreated datePublished" datetime="2022-01-22T19:21:19+08:00">2022-01-22</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/%E5%B7%A5%E7%A8%8B%E5%8C%96/" itemprop="url" rel="index"><span itemprop="name">工程化</span></a>
                </span>
            </span>

          
            <span class="post-meta-item" title="阅读次数" id="busuanzi_container_page_pv" style="display: none;">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              <span class="post-meta-item-text">阅读次数：</span>
              <span id="busuanzi_value_page_pv"></span>
            </span>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <h2 id="简介"><a href="#简介" class="headerlink" title="简介"></a>简介</h2><p>​            编程通过结构+算法对数据的处理，那么在编程的时候，遇到或自己想到的优秀    的处理数据的方案，就需要记录下来方便再次使用，所以，“cky小站”应然而生，往后的编程生涯里学到的知识都会在这里记录。</p>
<h2 id="建站想法"><a href="#建站想法" class="headerlink" title="建站想法"></a>建站想法</h2><p>​    需求：在本地编写md文档，快速部署到网页上</p>
<ol>
<li><p>最开始的想法是动手写原生的，在前端项目里，把写好的md文档放在一个文件夹，通过webpack的loader去解析或使用一些库，如果写在模块里面解析出来可以生效效果还挺好，但是单独写到md文件再去解析就报了很多错，加上游览器的沙盒机制，在前端直接访问本地的文件受到很多限制。</p>
</li>
<li><p>那么前端不行，便在后端实现，使用node的fs模块readFile获取md文件内容，marked库将内容转换成html，通过http服务放到body中，前端请求下来使用vue的v-html渲染在页面上，再通过Jenkins持续部署，pm2管理node自动重启。</p>
<span id="more"></span></li>
<li><p>某天看了一遍三分钟搭建博客的文章，GitHub Pages+hexo，能自动解析md文档，选个主题页面自动生成，用户名.github.io就能访问，完全符合最初的需求，最终便使用这个方法，直接免去页面和后台的编写。</p>
</li>
</ol>
<h2 id="实践"><a href="#实践" class="headerlink" title="实践"></a>实践</h2><h5 id="gitpages-也可以快速部署，但是每次上传到git，还要去页面手动点一下更新，所以我用自己的服务器配合持续部署的方案，使用方便还能增强稳定性。"><a href="#gitpages-也可以快速部署，但是每次上传到git，还要去页面手动点一下更新，所以我用自己的服务器配合持续部署的方案，使用方便还能增强稳定性。" class="headerlink" title="gitpages 也可以快速部署，但是每次上传到git，还要去页面手动点一下更新，所以我用自己的服务器配合持续部署的方案，使用方便还能增强稳定性。"></a>gitpages 也可以快速部署，但是每次上传到git，还要去页面手动点一下更新，所以我用自己的服务器配合持续部署的方案，使用方便还能增强稳定性。</h5><p>工具选择：</p>
<ol>
<li>gitee( GitHub访问等半天惆怅 ) ，暂存静态网页</li>
<li>hexo( next主题 )，解析md文档生成静态网页，丰富的主题可选</li>
<li>Jenkins ，自动clone gitee的静态网页并部署 </li>
<li>nginx ， 部署项目</li>
</ol>
<h5 id="1-使用hexo秒搭博客"><a href="#1-使用hexo秒搭博客" class="headerlink" title="1.使用hexo秒搭博客"></a>1.使用hexo秒搭博客</h5><p>官方文档：<a target="_blank" rel="noopener" href="https://hexo.io/zh-cn/index.html">https://hexo.io/zh-cn/index.html</a></p>
<figure class="highlight awk"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">npm install hexo-cli -g   <span class="regexp">//</span>安装脚手架</span><br><span class="line">hexo init blog 		<span class="regexp">//</span>会从github拉取初始化项目</span><br></pre></td></tr></table></figure>

<p><img src="/2022/01/22/jenkins-hexo%E6%90%AD%E5%BB%BA%E5%8D%9A%E5%AE%A2/image-20220122173731512.png" alt="image-20220122173731512"></p>
<figure class="highlight mipsasm"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">cd <span class="keyword">blog</span></span><br><span class="line"><span class="keyword"></span>npm <span class="keyword">install</span></span><br><span class="line"><span class="keyword"></span>hexo server</span><br></pre></td></tr></table></figure>

<p>执行完上面几条命令，就可以在server页面看到初始效果，下面是常用的命令</p>
<figure class="highlight awk"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">hexo new <span class="string">&quot;新文章&quot;</span>  <span class="regexp">//</span>可以发布新文章</span><br><span class="line">hexo g -d <span class="regexp">//g</span>生成静态网站在public文件中, d是提交到gitee上</span><br><span class="line">hexo clean  <span class="regexp">//</span>清除public的静态资源</span><br></pre></td></tr></table></figure>

<p>对网站的个人信息修改，我们只需要在_config.yml文件中配置，下面是常用的配置</p>
<p><img src="/2022/01/22/jenkins-hexo%E6%90%AD%E5%BB%BA%E5%8D%9A%E5%AE%A2/image-20220122165520669.png" alt="image-20220122165520669"></p>
<p><img src="/2022/01/22/jenkins-hexo%E6%90%AD%E5%BB%BA%E5%8D%9A%E5%AE%A2/image-20220122170027143.png" alt="image-20220122170027143"></p>
<p><img src="/2022/01/22/jenkins-hexo%E6%90%AD%E5%BB%BA%E5%8D%9A%E5%AE%A2/image-20220122193140980.png" alt="image-20220122193140980"></p>
<p>博客的主题可以在网上找到很多，我这里选的经典的next主题 (简约的风格看了很爽)，主题下载之后想更改主题的内容，可到theme/next/的_config.yml配置。具体方法到主题对应的文档可找到。</p>
<h6 id="小结：我们把文章写在md文档里，通过hexo-g-d-便可将生成的public文件上传到远程仓库。"><a href="#小结：我们把文章写在md文档里，通过hexo-g-d-便可将生成的public文件上传到远程仓库。" class="headerlink" title="小结：我们把文章写在md文档里，通过hexo g -d 便可将生成的public文件上传到远程仓库。"></a>小结：我们把文章写在md文档里，通过hexo g -d 便可将生成的public文件上传到远程仓库。</h6><h4 id="Jenkins-nginx实现服务器自动更新和部署"><a href="#Jenkins-nginx实现服务器自动更新和部署" class="headerlink" title="Jenkins+nginx实现服务器自动更新和部署"></a>Jenkins+nginx实现服务器自动更新和部署</h4><p>软件的安装这里就不介绍了，下面是Jenkins配置的方案</p>
<p>1.首先在Jenkins控制面板新建方案</p>
<p><img src="/2022/01/22/jenkins-hexo%E6%90%AD%E5%BB%BA%E5%8D%9A%E5%AE%A2/image-20220122180718570.png" alt="image-20220122180718570"></p>
<p>2.配置方案</p>
<p><img src="/2022/01/22/jenkins-hexo%E6%90%AD%E5%BB%BA%E5%8D%9A%E5%AE%A2/image-20220122181253153.png" alt="image-20220122181253153"></p>
<p><img src="/2022/01/22/jenkins-hexo%E6%90%AD%E5%BB%BA%E5%8D%9A%E5%AE%A2/image-20220122181656701.png" alt="image-20220122181656701"></p>
<p><img src="/2022/01/22/jenkins-hexo%E6%90%AD%E5%BB%BA%E5%8D%9A%E5%AE%A2/image-20220122182159824.png" alt="image-20220122182159824"></p>
<p><img src="/2022/01/22/jenkins-hexo%E6%90%AD%E5%BB%BA%E5%8D%9A%E5%AE%A2/image-20220122182508961.png" alt="image-20220122182508961"></p>
<p><img src="/2022/01/22/jenkins-hexo%E6%90%AD%E5%BB%BA%E5%8D%9A%E5%AE%A2/image-20220122182747306.png" alt="image-20220122182747306"></p>
<figure class="highlight awk"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line"><span class="regexp">//</span>最后在选择执行shell，一行一行写上构建需要执行的shell命令</span><br><span class="line"></span><br><span class="line">cd <span class="regexp">/usr/</span>local/nginx  <span class="comment">#进入nginx目录</span></span><br><span class="line">rm -rf blog			<span class="comment">#删除旧的blog</span></span><br><span class="line">mkdir blog			<span class="comment">#创建新的blog</span></span><br><span class="line"></span><br><span class="line">cd <span class="regexp">/var/</span>lib<span class="regexp">/jenkins/</span>workspace/blog		<span class="comment">#Jenkins构建后会自动拉去gitee项目到这里</span></span><br><span class="line">tar -zcvf <span class="string">&quot;/usr/local/nginx/blog/blog.tar.gz&quot;</span> *   <span class="comment">#将文件压缩到nginx目录下</span></span><br><span class="line"></span><br><span class="line">cd <span class="regexp">/usr/</span>local<span class="regexp">/nginx/</span>blog	<span class="comment">#进入压缩位置</span></span><br><span class="line">tar -zxvf blog.tar.gz		<span class="comment">#解压</span></span><br><span class="line"></span><br><span class="line">rm -rf blog.tar.gz			<span class="comment">#删除压缩文件</span></span><br><span class="line"></span><br><span class="line">cd <span class="regexp">/usr/</span>local<span class="regexp">/nginx/</span>sbin 	<span class="comment">#重启nginx</span></span><br><span class="line">./nginx -s reload</span><br><span class="line">cd</span><br></pre></td></tr></table></figure>

<p>3.至此，在nginx开个server，因为配置了gitee的webhooks，所以每次在本地push之后，gitee便会通知Jenkins开始构建，拉取最新上传的文件，并执行shell语句。</p>
<h2 id="总结"><a href="#总结" class="headerlink" title="总结"></a>总结</h2><p>做完以上的步骤，就可以在本地，把写好的md文件，通过hexo g -d 上传到gitee，网站也会自动更新。 </p>

    </div>

    
    
    
        

  <div class="followme">
    <p>欢迎关注我的其它发布渠道</p>

    <div class="social-list">

        <div class="social-item">
          <a target="_blank" class="social-link" href="/atom.xml">
            <span class="icon">
              <i class="fa fa-rss"></i>
            </span>

            <span class="label">RSS</span>
          </a>
        </div>
    </div>
  </div>


      <footer class="post-footer">
          <div class="post-tags">
              <a href="/tags/%E6%8C%81%E7%BB%AD%E9%83%A8%E7%BD%B2/" rel="tag"># 持续部署</a>
          </div>

        


        
    <div class="post-nav">
      <div class="post-nav-item">
    <a href="/2022/01/21/htmlcss%E5%B8%B8%E7%94%A8%E5%B1%9E%E6%80%A7/" rel="prev" title="htmlcss常用属性">
      <i class="fa fa-chevron-left"></i> htmlcss常用属性
    </a></div>
      <div class="post-nav-item"></div>
    </div>
      </footer>
    
  </article>
  
  
  



          </div>
          

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#%E7%AE%80%E4%BB%8B"><span class="nav-number">1.</span> <span class="nav-text">简介</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E5%BB%BA%E7%AB%99%E6%83%B3%E6%B3%95"><span class="nav-number">2.</span> <span class="nav-text">建站想法</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E5%AE%9E%E8%B7%B5"><span class="nav-number">3.</span> <span class="nav-text">实践</span></a><ol class="nav-child"><li class="nav-item nav-level-5"><a class="nav-link" href="#gitpages-%E4%B9%9F%E5%8F%AF%E4%BB%A5%E5%BF%AB%E9%80%9F%E9%83%A8%E7%BD%B2%EF%BC%8C%E4%BD%86%E6%98%AF%E6%AF%8F%E6%AC%A1%E4%B8%8A%E4%BC%A0%E5%88%B0git%EF%BC%8C%E8%BF%98%E8%A6%81%E5%8E%BB%E9%A1%B5%E9%9D%A2%E6%89%8B%E5%8A%A8%E7%82%B9%E4%B8%80%E4%B8%8B%E6%9B%B4%E6%96%B0%EF%BC%8C%E6%89%80%E4%BB%A5%E6%88%91%E7%94%A8%E8%87%AA%E5%B7%B1%E7%9A%84%E6%9C%8D%E5%8A%A1%E5%99%A8%E9%85%8D%E5%90%88%E6%8C%81%E7%BB%AD%E9%83%A8%E7%BD%B2%E7%9A%84%E6%96%B9%E6%A1%88%EF%BC%8C%E4%BD%BF%E7%94%A8%E6%96%B9%E4%BE%BF%E8%BF%98%E8%83%BD%E5%A2%9E%E5%BC%BA%E7%A8%B3%E5%AE%9A%E6%80%A7%E3%80%82"><span class="nav-number">3.0.0.1.</span> <span class="nav-text">gitpages 也可以快速部署，但是每次上传到git，还要去页面手动点一下更新，所以我用自己的服务器配合持续部署的方案，使用方便还能增强稳定性。</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#1-%E4%BD%BF%E7%94%A8hexo%E7%A7%92%E6%90%AD%E5%8D%9A%E5%AE%A2"><span class="nav-number">3.0.0.2.</span> <span class="nav-text">1.使用hexo秒搭博客</span></a><ol class="nav-child"><li class="nav-item nav-level-6"><a class="nav-link" href="#%E5%B0%8F%E7%BB%93%EF%BC%9A%E6%88%91%E4%BB%AC%E6%8A%8A%E6%96%87%E7%AB%A0%E5%86%99%E5%9C%A8md%E6%96%87%E6%A1%A3%E9%87%8C%EF%BC%8C%E9%80%9A%E8%BF%87hexo-g-d-%E4%BE%BF%E5%8F%AF%E5%B0%86%E7%94%9F%E6%88%90%E7%9A%84public%E6%96%87%E4%BB%B6%E4%B8%8A%E4%BC%A0%E5%88%B0%E8%BF%9C%E7%A8%8B%E4%BB%93%E5%BA%93%E3%80%82"><span class="nav-number">3.0.0.2.1.</span> <span class="nav-text">小结：我们把文章写在md文档里，通过hexo g -d 便可将生成的public文件上传到远程仓库。</span></a></li></ol></li></ol></li><li class="nav-item nav-level-4"><a class="nav-link" href="#Jenkins-nginx%E5%AE%9E%E7%8E%B0%E6%9C%8D%E5%8A%A1%E5%99%A8%E8%87%AA%E5%8A%A8%E6%9B%B4%E6%96%B0%E5%92%8C%E9%83%A8%E7%BD%B2"><span class="nav-number">3.0.1.</span> <span class="nav-text">Jenkins+nginx实现服务器自动更新和部署</span></a></li></ol></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E6%80%BB%E7%BB%93"><span class="nav-number">4.</span> <span class="nav-text">总结</span></a></li></ol></div>
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="cky"
      src="/images/avatar.jpg">
  <p class="site-author-name" itemprop="name">cky</p>
  <div class="site-description" itemprop="description">相见恨晚</div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/archives">
        
          <span class="site-state-item-count">4</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/categories">
          
        <span class="site-state-item-count">4</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/tags">
          
        <span class="site-state-item-count">4</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>



      </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

        
  <div class="beian"><a href="https://beian.miit.gov.cn/" rel="noopener" target="_blank">粤ICP备2021147162号-1 </a>
  </div>

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2022</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">cky</span>
</div>
  <div class="powered-by">由 <a href="https://hexo.io/" class="theme-link" rel="noopener" target="_blank">Hexo</a> & <a href="https://theme-next.org/" class="theme-link" rel="noopener" target="_blank">NexT.Gemini</a> 强力驱动
  </div>

        
<div class="busuanzi-count">
  <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
    <span class="post-meta-item" id="busuanzi_container_site_uv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="fa fa-user"></i>
      </span>
      <span class="site-uv" title="总访客量">
        <span id="busuanzi_value_site_uv"></span>
      </span>
    </span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item" id="busuanzi_container_site_pv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="fa fa-eye"></i>
      </span>
      <span class="site-pv" title="总访问量">
        <span id="busuanzi_value_site_pv"></span>
      </span>
    </span>
</div>








      </div>
    </footer>
  </div>

  
  <script src="/lib/anime.min.js"></script>
  <script src="/lib/velocity/velocity.min.js"></script>
  <script src="/lib/velocity/velocity.ui.min.js"></script>

<script src="/js/utils.js"></script>

<script src="/js/motion.js"></script>


<script src="/js/schemes/pisces.js"></script>


<script src="/js/next-boot.js"></script>




  




  
<script src="/js/local-search.js"></script>













  

  

</body>
</html>
